import socket,types
# import re,urllib,urllib2
# def file_write(filename,data):
# 	f = open(filename,'w')
# 	f.write(data)
# 	f.close()

# def file_read(filename):

# 	f = open(filename)
# 	data = f.read()
# 	f.close()
# 	return data
# # data = file_read('test1.html')
# request = urllib2.Request('http://tieba.baidu.com/p/4507524795')
# response = urllib2.urlopen(request)
# b = ''
# for i in response:
# 	b+=i 
# # print b
# pattern = re.compile('<img class="BDE_Image" src="(.*?)" size="\d{6} changedsize="true" width="\d{3}" height="\d{3}" size="\d{3}">',re.S)# reseult = re.search(pattern,data)
# # reseult = re.findall(pattern,b)
# print b
# # print reseult
# # items = re.findall(pattern,data)
# # # file_write('span.txt',items)
# # for item in items:
# # 	haveImg = 
# #     print item[0],item[1],item[2],item[3]
# # # print data
# # # print items
ip_pre = "211.87"
local_iP = socket.gethostbyname(socket.gethostname())
if ip_pre in str(local_iP):
    print str(local_iP)
ip_lists = socket.gethostbyname_ex(socket.gethostname())

for ip_list in ip_lists:
    if isinstance(ip_list, list):
        for i in ip_list:
            if ip_pre in str(i):
                print str(i)
    elif type(ip_list) is types.StringType:
        if ip_pre in ip_list:
            print ip_list